﻿using PetaPoco;
using PmSoft;
using PmSoft.Caching;
using System.ComponentModel;

namespace Modules.Person;

/// <summary>
/// 人员证书表
///</summary>
[TableName("person_certificate")]
[Description("人员证书")]
[PrimaryKey("id", AutoIncrement = false)]
[CacheSetting(true, PropertyNamesOfArea = "PersonId")]
[Serializable]
public class PersonCertificate : IEntity
{
    /// <summary>
    /// 主键
    ///</summary>
    [Column("id")]
    public string Id { get; set; }

    /// <summary>
    /// 人员id
    ///</summary>
    [Column("person_id")]
    public int PersonId { get; set; }

    /// <summary>
    /// 证书类型（证书字典表顶级）
    ///</summary>
    [Column("certificate_type")]
    public byte CertificateType { get; set; }

    /// <summary>
    /// 技能分类、执业注册类型
    ///</summary>
    [Column("skill_classification")]
    public string? SkillClassification { get; set; }

    /// <summary>
    /// 技能类别
    ///</summary>
    [Column("skill_category")]
    public string? SkillCategory { get; set; }

    /// <summary>
    /// 技能等级、资格名称、职称等级
    ///</summary>
    [Column("skill_level")]
    public string? SkillLevel { get; set; }

    /// <summary>
    /// 证书编号、注册证书编号、批准文号
    ///</summary>
    [Column("certificate_no")]
    public string? CertificateNo { get; set; }

    /// <summary>
    /// 发证日期、批准日期
    ///</summary>
    [Column("issue_date")]
    public DateTime? IssueDate { get; set; }

    /// <summary>
    /// 发证机关、审批机关
    ///</summary>
    [Column("issuing_authority")]
    public string? IssuingAuthority { get; set; }

    /// <summary>
    /// 持有人
    ///</summary>
    [Column("holder")]
    public string? Holder { get; set; }

    /// <summary>
    /// 执业印章号
    ///</summary>
    [Column("practicing_seal_number")]
    public string? PracticingSealNumber { get; set; }

    /// <summary>
    /// 注册有效期、有效期至
    ///</summary>
    [Column("register_end_date")]
    public DateTime? RegisterEndDate { get; set; }

    /// <summary>
    /// 资质证书状态
    ///</summary>
    [Column("status")]
    public string? Status { get; set; }

    /// <summary>
    /// 岗位证书专业、专业名称
    ///</summary>
    [Column("certificate_speciality")]
    public string? CertificateSpeciality { get; set; }

    /// <summary>
    /// 证书名称
    ///</summary>
    [Column("name")]
    public string? Name { get; set; }

    /// <summary>
    /// 评审组织
    ///</summary>
    [Column("review_organization")]
    public string? ReviewOrganization { get; set; }

    /// <summary>
    /// 创建时间
    ///</summary>
    [Column("create_time")]
    public DateTime CreateTime { get; set; }

    #region IEntity 成员

    [Ignore]
    object IEntity.EntityId { get { return this.Id; } }

    #endregion IEntity 成员
}